package com.our.biz;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.our.dao.UsersMapper;
import com.our.model.Users;
import com.our.util.BusinessException;

@Service
public class UsersBiz {
	@Resource
	private UsersMapper dao;

	public List<Users> findAll() throws BusinessException{
		try {
			return dao.selectAll();
		} catch (Exception e) {
			throw new BusinessException("E0101B05");
		}
	}
	

	public Users findByUsernameAndPassword(String username,String password){
		return dao.findByUsernameAndPassword(username,password);
	}


	public void updateAndChangeTixianCount(int tixianCount){
		dao.changeTixianCount(tixianCount);
	}

	public Users selectByUsername(String username){
		return dao.selectByUsername(username);
	}
}
